package pub.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Uerinfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "uerinfo", catalog = "sddf")
public class Uerinfo implements java.io.Serializable {

	// Fields

	private Integer id;
	private Role role;
	private String name;
	private String tbId;
	private String storeName;
	private Integer telephone;
	private Date birthday;
	private Integer qq;
	private String email;
	private String zfbId;
	private String zfbName;
	private Set<Service> services = new HashSet<Service>(0);
	private Set<Userlogin> userlogins = new HashSet<Userlogin>(0);

	// Constructors

	/** default constructor */
	public Uerinfo() {
	}

	/** minimal constructor */
	public Uerinfo(String name) {
		this.name = name;
	}

	/** full constructor */
	public Uerinfo(Role role, String name, String tbId, String storeName, Integer telephone, Date birthday, Integer qq, String email,
			String zfbId, String zfbName, Set<Service> services, Set<Userlogin> userlogins) {
		this.role = role;
		this.name = name;
		this.tbId = tbId;
		this.storeName = storeName;
		this.telephone = telephone;
		this.birthday = birthday;
		this.qq = qq;
		this.email = email;
		this.zfbId = zfbId;
		this.zfbName = zfbName;
		this.services = services;
		this.userlogins = userlogins;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "roleId")
	public Role getRole() {
		return this.role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@Column(name = "name", nullable = false, length = 20)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "tbId", length = 30)
	public String getTbId() {
		return this.tbId;
	}

	public void setTbId(String tbId) {
		this.tbId = tbId;
	}

	@Column(name = "storeName", length = 20)
	public String getStoreName() {
		return this.storeName;
	}

	public void setStoreName(String storeName) {
		this.storeName = storeName;
	}

	@Column(name = "telephone")
	public Integer getTelephone() {
		return this.telephone;
	}

	public void setTelephone(Integer telephone) {
		this.telephone = telephone;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "birthday", length = 10)
	public Date getBirthday() {
		return this.birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@Column(name = "qq")
	public Integer getQq() {
		return this.qq;
	}

	public void setQq(Integer qq) {
		this.qq = qq;
	}

	@Column(name = "email", length = 30)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "zfbId", length = 30)
	public String getZfbId() {
		return this.zfbId;
	}

	public void setZfbId(String zfbId) {
		this.zfbId = zfbId;
	}

	@Column(name = "zfbName", length = 30)
	public String getZfbName() {
		return this.zfbName;
	}

	public void setZfbName(String zfbName) {
		this.zfbName = zfbName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "uerinfo")
	public Set<Service> getServices() {
		return this.services;
	}

	public void setServices(Set<Service> services) {
		this.services = services;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "uerinfo")
	public Set<Userlogin> getUserlogins() {
		return this.userlogins;
	}

	public void setUserlogins(Set<Userlogin> userlogins) {
		this.userlogins = userlogins;
	}

}